package ru.myrtle.umf.query.condition.object;

import ru.myrtle.umf.UClass;
import ru.myrtle.umf.UObject;

public class UObjectTypeRelationCondition extends UObjectCondition {

    private final UClass type;
    private final UObjectTypeRelation relation;

    public UObjectTypeRelationCondition(UClass type, UObjectTypeRelation relation) {
        this.type = type;
        this.relation = relation;
    }

    @Override
    protected boolean isSatisfiedImpl(UObject object) {
        return relation.check(
                type, object.uClass()
        );
    }
}
